#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .. import command
from utility.odoo_manager import OdooManager

"""创建新用户"""
def handle_user_creation(command: command.CreateUserCommand) -> int:
    odoo = OdooManager().get_instance()
    data = {
        'name': command.name,
        'login': command.login,
        'mobile': command.mobile
    }
    new_id = odoo.env['res.users'].create(data)
    return new_id
